package com.wing.order.model.request;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.wing.order.model.entity.OrderReceiveLoad;
import com.wing.wcabinet.model.entity.WcabCellInventoryInout;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 上货数量Form
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class OrderReceiveLoadForm {

    /**
     * ID
     */
    private Long id;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 领货单id
     */
    private Long receiveId;

    /**
     * 领货明细id
     */
    private Long receiveDetailId;

    /**
     * 上货数量
     */
    private Integer quantity;

    /**
     * 柜子编码
     */
    private String cabCode;

    /**
     * 货道编号
     */
    private String spaceCode;

    /**
     * skuCode
     */
    private String skuCode;


    public interface Add{}

    public interface Update{}


    /**
     * 单号
     */
    private String code;

    private Integer day;

    private Integer no;

    private OrderReceiveLoad.Type type;

    private Long cabId;

    private Long spaceId;

    private Long skuId;

    private List<OrderReceiveLoadDetailForm> detailList;

    private WcabCellInventoryInout.OperationType operationType;

    private String enterpriseCode;

    private String departmentName;

    private String roleName;


    public enum LoadType implements IEnum<Integer> {

        /**
         * 补货上货
         */
        load(0,"上货"),
        /**
         * 自主上货
         */
        unload(1,"下货");

        private int code;
        private String desc;

        LoadType(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }

        @JsonCreator
        public static LoadType jsonCreator(String name) {
            if (StringUtils.isNotBlank(name)) {
                for (LoadType item : values()) {
                    if (item.name().equals(name.trim())) {
                        return item;
                    }
                }
            }
            return null;
        }
    }

    private Integer quantityPackUnit;

    private Long packId;

    private String packName;

    private String unitName;


}
